using System;
using System.Collections.Generic;
using NHibernate.Search.Attributes;
using NHibernate.Search;

namespace Ic.Model
{
	#region BandMailBox

	/// <summary>
	/// BandMailBox object for NHibernate mapped table 'TB_BandMailBox'.
	/// </summary>
	[Serializable]
	[TableInfo(TableName = "TB_BandMailBox", PrimaryKey = "Id" , Columns="Id,SentUserId,SentUserName,SendUserType,RecvUserId,RecvUserName,MailTitle,RecvUserType,MailText,SentDate,isRead")]
	[Indexed(Index = "BandMailBox")] 
	public class BandMailBox
	{
		#region Member Variables
		
		protected int _id;
		protected int _sentUserId;
		protected string _sentUserName;
		protected string _sendUserType;
		protected int _recvUserId;
		protected string _recvUserName;
		protected string _mailTitle;
		protected string _recvUserType;
		protected string _mailText;
		protected DateTime _sentDate;
		protected bool _isRead;

		#endregion

		#region Constructors

		public BandMailBox() { }

		public BandMailBox( int sentUserId, string sentUserName, string sendUserType, int recvUserId, string recvUserName, string mailTitle, string recvUserType, string mailText, DateTime sentDate, bool isRead )
		{
			this._sentUserId = sentUserId;
			this._sentUserName = sentUserName;
			this._sendUserType = sendUserType;
			this._recvUserId = recvUserId;
			this._recvUserName = recvUserName;
			this._mailTitle = mailTitle;
			this._recvUserType = recvUserType;
			this._mailText = mailText;
			this._sentDate = sentDate;
			this._isRead = isRead;
		}

		#endregion

		#region Public Properties

		[DocumentId]
		public virtual int Id
		{
			get {return _id;}
			set {_id = value;}
		}

		public virtual int SentUserId
		{
			get { return _sentUserId; }
			set { _sentUserId = value; }
		}

		[Field(Index.Tokenized, Store = Store.Yes)]
		public virtual string SentUserName
		{
			get { return _sentUserName; }
			set
			{
				if ( value != null && value.Length > 200)
					throw new ArgumentOutOfRangeException("Invalid value for SentUserName", value, value.ToString());
				_sentUserName = value;
			}
		}

		[Field(Index.Tokenized, Store = Store.Yes)]
		public virtual string SendUserType
		{
			get { return _sendUserType; }
			set
			{
				if ( value != null && value.Length > 10)
					throw new ArgumentOutOfRangeException("Invalid value for SendUserType", value, value.ToString());
				_sendUserType = value;
			}
		}

		public virtual int RecvUserId
		{
			get { return _recvUserId; }
			set { _recvUserId = value; }
		}

		[Field(Index.Tokenized, Store = Store.Yes)]
		public virtual string RecvUserName
		{
			get { return _recvUserName; }
			set
			{
				if ( value != null && value.Length > 200)
					throw new ArgumentOutOfRangeException("Invalid value for RecvUserName", value, value.ToString());
				_recvUserName = value;
			}
		}

		[Field(Index.Tokenized, Store = Store.Yes)]
		public virtual string MailTitle
		{
			get { return _mailTitle; }
			set
			{
				if ( value != null && value.Length > 200)
					throw new ArgumentOutOfRangeException("Invalid value for MailTitle", value, value.ToString());
				_mailTitle = value;
			}
		}

		[Field(Index.Tokenized, Store = Store.Yes)]
		public virtual string RecvUserType
		{
			get { return _recvUserType; }
			set
			{
				if ( value != null && value.Length > 10)
					throw new ArgumentOutOfRangeException("Invalid value for RecvUserType", value, value.ToString());
				_recvUserType = value;
			}
		}

		[Field(Index.Tokenized, Store = Store.Yes)]
		public virtual string MailText
		{
			get { return _mailText; }
			set
			{
				_mailText = value;
			}
		}

		public virtual DateTime SentDate
		{
			get { return _sentDate; }
			set { _sentDate = value; }
		}

		public virtual bool IsRead
		{
			get { return _isRead; }
			set { _isRead = value; }
		}

		

		#endregion
	}
	#endregion
}